from django.db import models

# Create your models here.
##++++作者表++++##
class Author(models.Model):
    name=models.CharField(max_length=15,null=False)#姓名
    age=models.CharField(max_length=15,null=False)#年龄
    sex=models.CharField(max_length=1,null=False)#性别
    hobby=models.CharField(max_length=255)#爱好
    dynasty=models.CharField(max_length=255)#朝代
##++++诗词表++++##
class Poem(models.Model):

    title=models.CharField(max_length=255)#标题
    thefirstleague=models.CharField(max_length=255)#首联
    hanlian=models.CharField(max_length=255)#颔联
    gengian=models.CharField(max_length=255)#颈联
    tailal=models.CharField(max_length=255)#尾联
    author=models.ForeignKey(Author,on_delete=models.CASCADE, related_name='author')